#include "pv.h"

PyDoc_STRVAR(event_doc,
"Event Type");

static PyObject *
event_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
	return type->tp_alloc(type, 0);
}

static int
event_init(PvEvent *self, PyObject *args, PyObject *kwds)
{
	return 0;
}

static void
event_dealloc(PyObject *self)
{
}

static PyMemberDef event_members[] = {
	{"type", T_INT, offsetof(PvEvent, type), 0, 
		"Type of the event"},
	{"object", T_OBJECT, offsetof(PvEvent, object), 0, 
		"Object handle this event"},
	{"id", T_OBJECT, offsetof(PvEvent, id), 0, 
		"Specify where the event emit"},
	{"time_stamp", T_INT, offsetof(PvEvent, time_stamp), 0, 
		"When the event emit"},
	{NULL}
};

static PyMethodDef event_methods[] = {
//	{"getwindows", (PyCFunction)event_getwindows, METH_NOARGS | METH_STATIC,
//		event_getwindows_doc},
	{NULL, NULL}
};


PyTypeObject PvEvent_Type = {
	PyObject_HEAD_INIT(0)
        "pv.event",		/* tp_name */
        sizeof(PvEvent),		/* tp_basicsize */
        0,				/* tp_itemsize */
        event_dealloc,		/* tp_dealloc */
        0,				/* tp_print */
        0,				/* tp_getattr */
        0,				/* tp_setattr */
        0,				/* tp_reserved */
        0,				/* tp_repr */
        0,				/* tp_as_number */
        0,				/* tp_as_sequence */
        0,				/* tp_as_mapping */
        0,				/* tp_hash */
        0,				/* tp_call */
        0,				/* tp_str */
        PyObject_GenericGetAttr,	/* tp_getattro */
        0,				/* tp_setattro */
        0,				/* tp_as_buffer */
        Py_TPFLAGS_DEFAULT,		/* tp_flags */
        event_doc,		/* tp_doc */
        0,				/* tp_traverse */
        0,				/* tp_clear */
        0,				/* tp_richcompare */
        0,				/* tp_weaklistoffset */
        0,				/* tp_iter */
        0,				/* tp_iternext */
        event_methods,		/* tp_methods */
        event_members,				/* tp_members */
        0,				/* tp_getset */
        0,				/* tp_base */
        0,				/* tp_dict */
        0,				/* tp_descr_get */
        0,				/* tp_descr_set */
        0,				/* tp_dictoffset */
        (initproc)event_init,				/* tp_init */
        0,				/* tp_alloc */
        event_new,				/* tp_new */
        0,				/* tp_free */
        0,				/* tp_is_gc */
};

